<template>
    <div>
        <Breadcrumb name1="权限管理" name2="权限列表"></Breadcrumb>
        <el-card>
            <el-table :data="rightsList" border stripe>
                <el-table-column type="index"></el-table-column>
                <el-table-column prop="authName" label="权限名称"></el-table-column>
                <el-table-column prop="path" label="路径"></el-table-column>
                <el-table-column label="权限等级">
                    <template slot-scope="scope">
                        <el-tag
                            :type="scope.row.level==0 ? '': scope.row.level==1 ? 'success':'warning'">
                            {{scope.row.level==0 ? "一级" : scope.row.level==1 ? "二级":"三级"}}
                        </el-tag>
                    </template>
                </el-table-column>
            </el-table>
        </el-card>
    </div>
</template>

<script>
import Breadcrumb from "../components/Breadcrumb.vue"
import { request } from '../../../api/axios'
export default {
    components:{ Breadcrumb },
    data(){
        return{
            // 获取到的权限列表
            rightsList:[],
        }
    },
    created(){
        this.getRightsList()
    },
    methods:{
        getRightsList(){
            request("get","rights/list")     //1.4.1  list
            .then(res =>{
                console.log(res)
                this.rightsList=res.data
            })
        }
    }
}
</script>